Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capture stack traces in worker panics #6

Merged
merged 5 commits into from
Sep 24, 2024
Merged

capture stack traces in worker panics #6

merged 5 commits into from
Sep 24, 2024

Conversation

mumbleskates
Copy link
Collaborator

we want to know where panics are happening inside parallelized functions :)

Copy link

@qslug qslug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. TIL about panic(nil) lore.

}
}

g.panicked.CompareAndSwap(nil, &wp)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why CompareAndSwap? Is there a risk of setting g.panicked twice?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty positive i just wanted to make sure that specifically the first panic sticks, rather than just "any panic who cares"

// nicely with the testing lib, but there doesn't seem to be any good
// way to xfail a golang test. As it happens t.Fatal() just sets a fail
// flag and then calls Goexit() anyway; if we treat nil recover() values
// as Goexit() (guaranteed since 1.21 with the advent of PanicNilError)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... realizes what it means that panic(nil) use to recover() as nil

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is some deep lore to how panic(nil) used to work (and be worked around)

@mumbleskates mumbleskates merged commit c70b8da into main Sep 24, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants